
import React, { Component } from 'react';
import Son from './Son';

export default class SonToParent extends Component {

    state = {
        level:"一级"
    }

    chuanFn(str){
        console.log("str",str);
        console.log("this",this);
    }

    goReactRedux=()=>{

      console.log("sonToParent:this.props",this.props);
      this.props.history.push("/Admin/ReactReduxDemo");
    }

  render() {
    return (
      <div>
        <h1>父子组件传值</h1>
        <input type='button' value="去react-redux" onClick={this.goReactRedux} />
        <hr />
        <Son level={this.state.level} chuan={this.chuanFn}  />
      </div>
    )
  }
}